<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Insert title here</title>
<style type="text/css">
   table{
         border-collapse: collapse;
   }
   tr,th,td{
         border:1px solid black;
         text-align:center;
   }
</style>
<script type="text/javascript">
   var v="queryByName";
   function change(val){
	   v=val;
   }
   function subf(){
	   /*注意这里的url和book.xml里的路径一定要对上*/
	   f.action="/book/"+v+".action";
	   f.submit();
   }
</script>
</head>
<body>
   <form name="f" method="post">
      关键字：<input name="keyWords" type="text"/><br/>
      <input type="radio" name="rd" value="queryByName" checked onclick="change(this.value)"/>按书名查询
      <input type="radio" name="rd" value="queryByAuthor" onclick="change(this.value)"/>按作者查询
      <input type="radio" name="rd" value="queryByPublish" onclick="change(this.value)"/>按出版社查询<br/>
      <input type="submit" value="查询" onclick="subf()"/>
      <!--此处的subf当时忘记写括号了，找错找了很久-->
   </form>
   <table>
      <tr>
         <th>编号</th>
         <th>书名</th>
         <th>作者</th>
         <th>出版社</th>
         <th>价格</th>
         <th>库存</th>
         <th>出版时间</th>
      </tr>
      <c:forEach items="${bookList}" var="n">
         <tr>
            <td>${n.isbn}</td>
            <td>${n.name}</td>
            <td>${n.author}</td>
            <td>${n.publish}</td>
            <td>${n.price}</td>
            <td>${n.currcount}</td>
            <td>${n.publishDate}</td>
         </tr>
      </c:forEach>
   </table>
</body>

</html>